package com.zksk.mbg.admin.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.zksk.common.core.web.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Update;

import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * <p>
 * 机构产品信息表
 * </p>
 *
 * @author Zksk Acmen
 * @since 2022-12-05
 */
@Data
@Accessors(chain = true)
@TableName("platform_org_product")
@ApiModel(value = "OrgProduct对象", description = "机构产品信息表")
public class OrgProduct extends BaseEntity {

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @NotNull(message = "主键不能为空", groups = {Update.class})
    private Long id;

    @ApiModelProperty("机构（平台）id")
    @TableField("org_id")
    @NotNull(message = "机构id不能为空", groups = {Update.class})
    private Long orgId;

    @ApiModelProperty("产品枚举id")
    @TableField("enum_prod_id")
    @NotNull(message = "产品不能为空", groups = {Insert.class, Update.class})
    private Long enumProdId;

    @ApiModelProperty("产品名称")
    @TableField("enum_prod_name")
    private String enumProdName;

    @ApiModelProperty("保函类型（直开式 分离式）保留字段")
    @TableField("l_g_type")
    private Integer lGType;

    @ApiModelProperty("需要的协议类型")
    @TableField("need_agreement_type")
    private String needAgreementType;

    @ApiModelProperty("机构产品加密要求")
    @TableField("encrypt_status")
    private Integer encryptStatus;

    @ApiModelProperty("机构产品对接标识（是否对接过同类业务） 0 无对接业务来往 1 已有对接业务")
    @TableField("docking_status")
    private Integer dockingStatus;

    @ApiModelProperty("激活状态0 未激活 1 已激活 ")
    @TableField("active_status")
    private Integer activeStatus;

    @TableField(value = "del_flag", fill = FieldFill.INSERT)
    @TableLogic
    private Integer delFlag;


    public static final String ID = "id";

    public static final String ORG_ID = "org_id";

    public static final String ENUM_PROD_ID = "enum_prod_id";

    public static final String ENUM_PROD_NAME = "enum_prod_name";

    public static final String L_G_TYPE = "l_g_type";

    public static final String NEED_AGREEMENT_TYPE = "need_agreement_type";

    public static final String ENCRYPT_STATUS = "encrypt_status";

    public static final String DOCKING_STATUS = "docking_status";

    public static final String ACTIVE_STATUS = "active_status";

    public static final String DEL_FLAG = "del_flag";

    @Override
    public Serializable pkVal() {
        return this.id;
    }

}
